package com.paziy.jan.calc.literals.brackets;

import com.paziy.jan.calc.literals.Literal;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

public abstract class Bracket extends Literal {

    //todo delete this block
    static private Map<Pattern,Class<? extends Bracket>> brackets;
    static {
        brackets = new HashMap<Pattern, Class<? extends Bracket>>();

        brackets.put(Pattern.compile("\\("), BracketLeft.class);
        brackets.put(Pattern.compile("\\)"), BracketRight.class);
    }

    public Bracket(String pattern) {
        super(pattern);
    }

    //todo delete this metod
    public static Map<Pattern,Class<? extends Bracket>> getBrackets() {
        return brackets;
    }
}
